package Structural_design_pattern.Decorator_Pattern.Example2;


//具体装饰类
public class AdvancedCipher extends CipherDecorator{
    public AdvancedCipher(Cipher cipher) {
        super(cipher);
    }

    public String Encrypt(String plainText) {
        String result = super.Encrypt(plainText);
        result = mod(result);
        return result;
    }

    public String mod(String text) {
        String str = "";
        for(int i=0; i<text.length(); i++) {
            String c = String.valueOf(text.charAt(i)%6);
            str += c;
        }
        return str;
    }
}
    

